﻿using UnityEngine;
using Matrix4x4 = UnityEngine.Matrix4x4;
using Vector2 = UnityEngine.Vector2;

namespace HotPlayer.Physic2D
{
    public class Matrix2D
    {
        private Matrix4x4 matrix;

        public Vector2 MultiplyPoint(Vector2 point)
        {
            switch (HotPhysic2D.mode)
            {
                case e2DMode.xz:
                    var ret = matrix.MultiplyPoint(new Vector3(point.x, 0, point.y));
                    return new Vector2(ret.x, ret.z);
            }
            Debug.LogError($"unsupported {HotPhysic2D.mode}");
            return point;
        }

        public void Update(Matrix4x4 matrix)
        {
            this.matrix = matrix;
        }
    }
}